//texture
uniform sampler2D diffuseMap;

//Materials
uniform vec4 Kd;
uniform vec4 Ks;
uniform vec4 Ka;
uniform float alpha;
uniform float transparency = 1.0;

//modes enabled
uniform int hasdiff;

//default
varying vec2 texcoord;


void main() {
  vec4 diffuse=vec4(0.0);
  vec4 specular=vec4(0.0);
  vec4 ambient=vec4(0.0);


  
  vec4 Td = (hasdiff==1)?texture2D(diffuseMap, texcoord):vec4(1.0);
  diffuse += Td *Kd;
  
  
  gl_FragColor = diffuse + specular + ambient;
  gl_FragColor.a =  gl_FragColor.a*transparency;
    
}
